<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.box{
			width: 200px;
			height: 200px;
			background-color: red;
		}
		div.hidden{
			display: none;
		}
	</style>
</head>
<body>
	<button>隐藏</button>
	<div class="box"></div>
	<script src="jquery.js"></script>
	<script>
		$(function () {
			/*
			var isShow = true;
			$('button').click(function(event) {
				if (isShow) {
					$('.box').addClass('hidden');
					isShow =false;
				}else{
					$('.box').removeClass('hidden');
					isShow = true;
				}
				
			});
			*/
			$('button').click(function(event) {

				$('.box').toggleClass('hidden');

			})
		})
	</script>
</body>
</html>